<template>
  <Sidebar>
    <div class="sidebar-title flex align-items-center">
      <div class="title-icon shrink-0">
        <svg-icon icon-name="gitlab_user" class-name="s24" />
      </div>
      <span class="m-l-10 title collapse-hide">用户设置</span>
    </div>
    <el-menu class="sidebar a-link-item" :default-active="active">
      <el-menu-item class="sidebar-item" index="password">
        <router-link to="/users/settings/password">
          <svg-icon icon-name="sprite_icons_lock" />
          <span class="m-l-10 collapse-hide flex-1">密码</span>
        </router-link>
      </el-menu-item>
      <el-menu-item class="sidebar-item" index="oauth2">
        <router-link to="/users/settings/oauth2">
          <svg-icon icon-name="sprite_icons_account" />
          <span class="m-l-10 collapse-hide">账号绑定</span>
        </router-link>
      </el-menu-item>
    </el-menu>
  </Sidebar>
</template>

<script>
import Sidebar from '@/components/shared/Sidebar';

export default {
  name: 'UserSettingsSidebar', // 个人中心界面的侧边栏
  components: { Sidebar },
  computed: {
    active() { return this.$route.path.split('/')[3] || 'password'; },
  },

};
</script>

<style></style>
